close all;clear;clc;

%%

% 文件路径
filename = 'hdf5/dif-async.hdf5';

if contains(filename, 'cvae')
    model = '/catch_shoes_20250313';
else
    model = '/catch_shoes_dif20250305';
end

% 读取数据
current_pos = h5read(filename, sprintf('%s/current_pos', model));
qpos = h5read(filename, sprintf('%s/qpos', model));
process_result = h5read(filename, sprintf('%s/process_result', model));

% 读取 control 组的数据
aim_pos = h5read(filename, '/control/aim_pos');
real_pos = h5read(filename, '/control/real_pos');
% torques = h5read(filename, '/control/torques');
vels = h5read(filename, '/control/vels');

%%
% % 模型预测的值
% checkbox_slider_plot(process_result, 1, 100, 14, "process_result--网络输出")
% 
% % 发给模型的输出
% checkbox_plot(real_pos, 20, 'real_pos--发给模型的目标值');
% 
% % 绘制实际速度
% checkbox_plot(vels, 20, 'vels');
% 
% % 绘制current_pos 
% checkbox_plot(current_pos, 14, 'current_pos--没有反归一的实际值');

%%
% real_pos1 = real_pos(1:14, :);
% real_pos1(end+1, :) = real_pos(end);
% checkbox_multi_plot({aim_pos, real_pos1}, 14, 'aim_and_cur');
